
Partial Class Controls_SVList
    Inherits System.Web.UI.UserControl

    Private Const Q As String = Chr(34)

    Private msSelectedServerID As String = ""
    Private msSelectedDatabaseID As String = ""

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Public Property SelectedServerID() As String
        Get
            Return msSelectedServerID
        End Get
        Set(ByVal value As String)
            msSelectedServerID = value
        End Set
    End Property

    Public Property SelectedDatabaseID() As String
        Get
            Return msSelectedDatabaseID
        End Get
        Set(ByVal value As String)
            msSelectedDatabaseID = value
        End Set
    End Property

    Protected Sub ShowServerList()
        '---Display list of servers
        Dim oFactory As New SQLAutoDocLib.Server_Factory
        Dim oList As ArrayList = oFactory.AllActiveServers

        Dim sHTM As New StringBuilder

        For Each oServer As SQLAutoDocLib.Server In oList
            sHTM.Append("<tr>")
            sHTM.Append("<td>")
            sHTM.Append("<a href=" & Q & oServer.ID & Q & ">")
            If oServer.IsActive = True Then
                sHTM.Append(oServer.Name)
            Else
                sHTM.Append("<i>" & oServer.Name & "</i>")
            End If
            sHTM.Append("</a>")
            sHTM.Append("</td>")
            sHTM.Append("</tr>")
        Next
    End Sub
End Class
